package com.bj58.groupbuy.action.service.impl;

import java.util.List;

import com.bj58.groupbuy.action.db.CommonDao;
import com.bj58.groupbuy.action.db.DBConfig;
import com.bj58.groupbuy.action.model.JxedtFlowSource;
import com.bj58.groupbuy.action.service.JxedtFlowSourceService;

public class JxedtFlowSourceServiceImpl implements JxedtFlowSourceService {
	private CommonDao comDao = new CommonDao();
	
	@Override
	public List<JxedtFlowSource> getSource1List(String platform) throws Exception {
		StringBuffer sql = new StringBuffer();
		sql.append(" SELECT *  ");
		sql.append(" FROM data_dict.jxedt_netflow_source ");
		sql.append(" where platform = '"+platform+"' ");
		sql.append(" group by source1 ");
		
		return comDao.getAllColsByVo(sql.toString(), JxedtFlowSource.class, DBConfig.db_131_data_bi.getIntType());
	}

	@Override
	public List<JxedtFlowSource> getSource2List(String platform,String source1)
			throws Exception {
		StringBuffer sql = new StringBuffer();
		sql.append(" SELECT *  ");
		sql.append(" FROM data_dict.jxedt_netflow_source ");
		sql.append(" where source1 = '" + source1 + "' ");
		sql.append(" and platform = '"+platform+"'  ");
		sql.append(" group by source2 ");
		
		return comDao.getAllColsByVo(sql.toString(), JxedtFlowSource.class, DBConfig.db_131_data_bi.getIntType());
	}

}
